#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWidget>
#include <QLineEdit>
#include <QTextEdit>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QPushButton>
#include <QFrame>
#include <QMenu>
#include <QMap>

#include "board.h"
#include "boardview.h"
#include "connection.h"
#include "dialogs/chatwindow.h"

class MainWindow : public QMainWindow {
  Q_OBJECT

public:
  MainWindow (QWidget* parent=0);

public slots:
  void changeBoardVisibility( bool );
  void changeConsoleVisibility( bool );
  void printConsole( const QString& );
  void processLine( const QString& );
  void sendCommand();
  void sendExternalCommand(const QString&);
  void connectToServer();
  void updateChat(const QString&, const QString&);

private:
  void setMainLayout();
  void drawBoard();
  void setupMenu();
  void syncViewToMenu();

  QLineEdit* commandEdit;
  QPushButton* sendCommandButton;
  QTextEdit* consoleOutput;
  BoardView* boardView;
  Board* board;
  Connection* conn;
  QMap<QString, ChatWindow*> chatWindows;
};

#endif
